//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "fn_waitForMed.sqf"
#include <btc_macros.h>
TRACE_1("Start",_this);


	BTC_r_med_effect = true;
	_state = player getVariable "BTC_r_status";
	player setVariable ["BTC_r_status",[(_state select 0),(_state select 1),(_state select 2),(_state select 3),1],true];	
	while {BTC_r_med_effect} do
	{
		if (BTC_r_damage_legs > 0.5) then
		{
			player setHit ["legs", 1];player forceWalk true;
			if (stance player != "PRONE") then 
			{
				switch (true) do
				{
					case (currentweapon player == "") : {player playmove "AmovPpneMstpSrasWnonDnon";};
					case (currentweapon player == handgunweapon player) : {player playmove "AmovPpneMstpSrasWpstDnon";};
					case (currentweapon player == primaryweapon player) : {player playmove "AmovPpneMstpSrasWrflDnon";};
					case (currentweapon player == secondaryweapon player) : {player playmove "AmovPpneMstpSrasWlnrDnon";};
				};
			};
		};
		if (BTC_r_damage_hands > 0.5) then
		{
			player setHit ["hands", 1];
		};
		if (BTC_r_damage_legs == 0 && BTC_r_damage_hands == 0) then {BTC_r_med_effect = false;};		
		sleep 2;
	};
	player forceWalk false;
